//
//  DTCMQTTManager.h
//  MQTTDemo
//
//  Created by JianWei Chen on 2017/11/22.
//  Copyright © 2017年 JianWei Chen. All rights reserved.
//

#import <Foundation/Foundation.h>

@class DTCMQTTManager;
@protocol DTCMQTTManagerDelegate <NSObject>

@required
- (void)mqttManager:(DTCMQTTManager *)manager connectResult:(NSError *)error;

- (void)mqttManager:(DTCMQTTManager *)manager messageBack:(NSData *)data topic:(NSString *)topic;

@end

@interface DTCMQTTManager : NSObject

+ (id)shareManagerWithDeleagate:(id <DTCMQTTManagerDelegate>)delegate;

- (void)connectToHost:(NSString *)hostString port:(int)port;

- (void)disconnect;

- (void)subscribeSubject:(NSString *)topic;

- (void)publishData:(NSData *)data onTopic:(NSString *)topic;

@end
